package com.winhxd.b2c.common.domain.order.enums;

/**
 * 售后类型
 * @author lining
 * @create 2019-01-07 16:30
 **/
public enum OrderAfterSaleTypeEnum {

    WAIT_DELIVERING_REFUND(1,"待发货-退款"),
    WAIT_RECEIVING_REFUND_AND_RETURN(2,"待收货-退款退货"),
    WAIT_RECEIVING_EXCHANGE(3,"待收货-换货"),
    FINISHED_REFUND_AND_RETURN(5,"已收货-退款退货"),
    FINISHED_EXCHANGE(6,"已收货-换货");

    private Integer typeCode;
    private String typeDesc;
    public Integer getTypeCode() {
        return typeCode;
    }
    public String getTypeDesc() {
        return typeDesc;
    }

    OrderAfterSaleTypeEnum(Integer typeCode, String typeDesc) {
        this.typeCode = typeCode;
        this.typeDesc = typeDesc;
    }

    public static String getDescByCode(Integer code) {
        if (null != code) {
            for (OrderAfterSaleTypeEnum typeEnum : OrderAfterSaleTypeEnum.values()) {
                if (typeEnum.getTypeCode().intValue() == code.intValue()) {
                    return typeEnum.getTypeDesc();
                }
            }
        }
        return null;
    }
}
